package cn.iocoder.yudao.module.wine.dal.mysql.supplyorderlog;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
import cn.iocoder.yudao.module.wine.dal.dataobject.supplyorderlog.SupplyOrderLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wine.controller.admin.supplyorderlog.vo.*;

/**
 * 供求订单日志 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface SupplyOrderLogMapper extends BaseMapperX<SupplyOrderLogDO> {

    default PageResult<SupplyOrderLogRespVO> selectPage(SupplyOrderLogPageReqVO reqVO) {
        return selectJoinPage(reqVO,SupplyOrderLogRespVO.class, new MPJLambdaWrapperX<SupplyOrderLogDO>()
                .eqIfPresent(SupplyOrderLogDO::getUserId, reqVO.getUserId())
                .likeIfPresent(SupplyOrderLogDO::getUserType, reqVO.getUserType())
                .eqIfPresent(SupplyOrderLogDO::getOrderId, reqVO.getOrderId())
                .likeIfPresent(SupplyOrderLogDO::getBeforeStatus, reqVO.getBeforeStatus())
                .likeIfPresent(SupplyOrderLogDO::getAfterStatus, reqVO.getAfterStatus())
                .eqIfPresent(SupplyOrderLogDO::getOperateType, reqVO.getOperateType())
                .eqIfPresent(SupplyOrderLogDO::getContent, reqVO.getContent())
                .betweenIfPresent(SupplyOrderLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SupplyOrderLogDO::getId));
    }

}
